package com.autumn.cloud.gateway.controllers;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

/**
 * <p>
 * </p>
 *
 * @description TODO
 * @author: 老码农
 * @create: 2020-12-16 04:27
 **/
@Getter
@Setter
public class ErrorResponse implements Serializable {
    private static final long serialVersionUID = 3455606650325959206L;

    private boolean success = false;

    private ErrorInfo error;

    public static ErrorResponse fail(String message) {
        ErrorResponse response = new ErrorResponse();
        response.setSuccess(false);
        response.setError(new ErrorInfo());
        response.getError().setCode(-250);
        response.getError().setMessage(message);
        return response;
    }
}
